package org.jeecg.modules.xl.order.controller;

import cn.hutool.core.util.RandomUtil;
import org.dromara.pdf.fop.handler.TemplateHandler;
import org.jeecg.modules.xl.order.entity.XlCustomerOrde;

import javax.servlet.http.HttpServletResponse;

public class PdfHandle2 {
    public static void handle(XlCustomerOrde order, HttpServletResponse response ) {
        String outputPath = ("/Users/deco/Downloads/temp/hello-world-"+ RandomUtil.randomNumbers(6)+".pdf");
        TemplateHandler.Document.build().addPage(
                TemplateHandler.Page.build().addBodyComponent(
                        TemplateHandler.Text.build().setText("hello world")
                )
        ).transform(outputPath);
    }
}
